/***************************************************************************
 *   Copyright (C) 2009 by Bernhard Neuhofer   *
 *   mail@bneu.at   *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/
#ifndef SQTWADAPTER_H
#define SQTWADAPTER_H

#include "rollbackableAdapter.h"
#include "message.h"
#include "modelentity.h"

/**
* @brief Adapter for SQTW. Used to save/restore the MEs state and to
* decide to/from which queue the next message should be saved/taken
* (depends on the state of the associated ME)
*/
class SqtwAdapter:public RollbackableAdapter
{
	public:
		/**
		 * Returns the number of the input queue 
		 * in which the message should be queued into
		 * @param message The message in question
		 * @return Queue number
		 */
		virtual unsigned int intoWhichQueue ( Message* message ) =0;

		/**
		 * Return the number of the input queue where the next message should 
		 * be read from. Depends on the state of the model entity.
		 * @param modelEntity The model entity in question
		 * @return unsigend int Queue number
		 */
		virtual unsigned int outOfWhichQueue ( ModelEntity* modelEntity ) =0;
};

#endif